package com.chenxiao.mybatisplus.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chenxiao.mybatisplus.aop.annotation.WebLog;
import com.chenxiao.mybatisplus.entity.AjaxResult;
import com.chenxiao.mybatisplus.entity.OrderDto;
import com.chenxiao.mybatisplus.service.OrderService;
import com.chenxiao.mybatisplus.service.RecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Chenxiao
 * @Date: 2022-07-31 23:20
 * @Description: testController
 */
@RestController
@Api(tags = "mybatis-test")
public class testController {
    @Autowired
    private OrderService orderService;
    @Autowired
    private RecordService recordService;

    /**
     * 分页测试
     * @param page
     * @return
     */
    @WebLog
    @ApiOperation("分页功能测试")
    @GetMapping("/test/queryOrderPage/{page}")
    public AjaxResult queryOrderPage(@PathVariable Long page){

        List<OrderDto> orderDto = orderService.queryOrderList();
        return new AjaxResult("200",orderDto);
    }
}
